import Vue from 'vue'
import Router from 'vue-router'
import ShopManage from '@/components/ShopManage'
import ShopDrawbackManage from '@/components/ShopDrawbackManage'
import Index from '@/components/Index'
import Home from '@/components/Home'
import OrderManage from '@/components/OrderManage'
import login from '@/components/login'
import ShopTypes from '@/components/ShopTypes'
import Statistics from '@/components/Statistics'
import GoodsManage from '@/components/GoodsManage'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    redirect: '/login'
  }, {
    path: '/login',
    component: login
  }, {
    path: '/home',
    component: Home,
    children: [{
      path: '/',
      redirect: '/home/index'
    }, {
      path: '/home/index',
      name: 'Index',
      component: Index
    }, {
      path: '/home/shopManage',
      name: 'ShopManage',
      component: ShopManage
    }, {
      path: '/home/shopDrawbackManage',
      name: 'ShopDrawbackManage',
      component: ShopDrawbackManage
    }, {
      path: '/home/orderManage',
      name: 'OrderManage',
      component: OrderManage
    }, {
      path: '/home/shopTypeManage',
      name: 'ShopTypeManage',
      component: ShopTypes
    }, {
      path: '/home/statistics',
      name: 'Statistics',
      component: Statistics
    }, {
      path: '/home/goodsManage',
      name: 'GoodsManage',
      component: GoodsManage
    }]
  }]
})
